package com.kitty.game.xmd;


/**
 * 仙魔请求自动加点
 */
import com.kitty.game.child.model.ChildInfo;
import com.kitty.game.role.model.Role;
import com.kitty.mina.annotation.RequestMapping;
import com.kitty.mina.cache.SessionUtils;
import com.kitty.mina.message.MessagePusher;
import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class RequestRecommendXmdController {
    Logger logger = LoggerFactory.getLogger(RequestRecommendXmdController.class);

    @RequestMapping
    public void request_xmd(IoSession session,requestRecommendInfo RecommendInfo) {
        Role role = SessionUtils.getRoleBySession(session);
        ChildInfo info = role.getChildInfo();
        RecommendXmdInfo recommendXmdInfo = new RecommendXmdInfo();
        recommendXmdInfo.setAddType(info.getUpgradeAddType());
        recommendXmdInfo.setIsOpen(info.getUpgradeIsOpen());
        MessagePusher.pushMessage(role, recommendXmdInfo);
    }
}
